﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DcsGauges.Gui.Gauges.Interfaces;

namespace DcsGauges.Gui.Gauges.ValueConverters
{
    class BoolConverter : IGaugeValueConverter<float, bool>
    {
        private float               median              = 0.5f;

        public BoolConverter(float median)
        {
            this.median         = median;
        }

        public bool Convert(float inValue)
        {
            return inValue > median;
        }

        public float ConvertBack(bool value)
        {
            if(value) return 0.0f;
            else      return 1.0f;
        }
    }
}
